package a66weding.com.jiehuntong.activity.toolstask;

import android.content.Context;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.PopupWindow;

import a66weding.com.jiehuntong.R;
import a66weding.com.jiehuntong.application.DataWareHourse;
import a66weding.com.jiehuntong.beans.User;
import me.imid.swipebacklayout.lib.app.SwipeBackActivity;

/**
 * @version :
 * @creator : AxDu
 * @create-time : 2016/6/28
 * @description :
 */
public class BaseWedTaskActivity extends SwipeBackActivity {

    User user;
    protected String mobileNum;

    public PopupWindow mCommitpop;
    private View noNetView;

    public BaseWedTaskActivity(){

    }

    @Override
    public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
        super.onCreate(savedInstanceState, persistentState);
        User user = DataWareHourse.getInstance().getmUser();
        mobileNum = user.getData().get(0).getNvc_MobilePhone();

    }

    protected void initdata(){

    }


    public void showCommitPopupWindow(Context context, View view) {
        // 一个自定义的布局，作为显示的内容
        View contentView = LayoutInflater.from(context).inflate(
                R.layout.pop_tools_wedregister_commit, null);
        mCommitpop = new PopupWindow(contentView,
                ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, true);

        //点击空白处时，隐藏掉pop窗口
        mCommitpop.setTouchable(true);
        mCommitpop.setTouchInterceptor(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                return true;
            }
        });
        //设置位置
        mCommitpop.showAtLocation(view, Gravity.BOTTOM|Gravity.CENTER_HORIZONTAL,0,0);
        // 设置好参数之后再show
        mCommitpop.showAsDropDown(view);

    }






}
